#ifndef SOFTSPI_HPP
#define SOFTSPI_HPP

#include "IODevice.hpp"
#include "Pin.hpp"

class SoftSPI : public IODevice{
public:
    SoftSPI(Pin *mosi,Pin *miso,Pin *sck);
    virtual int write(unsigned char *buff,int size);
    virtual int read(unsigned char *buff,int size);
    int transmit(unsigned char *txbuffer,unsigned char *rxbuffer,int size);
private:
    void delay();
private:
    Pin *mosi;
    Pin *miso;
    Pin *sck;
};

#endif
